<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('终端划拨')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-newMigrate-update" enctype="multipart/form-data">
        <h4 class="form-header h6">原代理信息:</h4>
        <div class="row">
            <div class="form-group">
                <label class="col-sm-3 control-label  is-required" >代理商编号：</label>
                <div class="col-sm-8">
                    <input name="agentNum" readonly type="text" id="agentNum" class="form-control" th:value="${agentNum}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label  is-required">代理商名称：</label>
                <div class="col-sm-8">
                    <input name="agentName" readonly type="text" class="form-control" th:value="${agentName}" required>
                </div>
            </div>
        </div>
        <h4 class="form-header h6">客户信息:</h4>
        <div class="row">
            <div class="form-group">
                <label class="col-sm-3 control-label  is-required">商户编号：</label>
                <div class="col-sm-8">
                    <input name="merNo" readonly type="text" class="form-control"
                           th:value="${merchantInfo.get('MERNO')}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label  is-required">商户名称：</label>
                <div class="col-sm-8">
                    <input name="merName" readonly type="text" class="form-control"
                           th:value="${merchantInfo.get('MER_NAME')}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label  is-required">SN编号：</label>
                <div class="col-sm-8">
                    <input name="sn" readonly type="text" class="form-control" th:value="${sn}">
                </div>
            </div>
        </div>
        <h4 class="form-header h6">新代理信息:</h4>
        <div class="row">
            <div class="form-group">
                <label class="col-sm-3 control-label  is-required">代理商编号：</label>
                <div class="col-sm-8">
                    <input name="newAgentNum" onclick="selectAgent()" readonly id="xagentNum" type="text"
                           class="form-control" required>
                    <i class="fa fa-search" style="margin-top: -22px;margin-right:3px;float:right;"></i>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">代理商名称：</label>
                <div class="col-sm-8">
                    <input name="newAgentName" class="form-control" id="xagentName" type="text" readonly required>
                </div>
            </div>
        </div>
        <h4 class="form-header h6">返现对象：</h4>
        <div class="row">
            <div class="form-group">
                <label class="col-sm-3 control-label  is-required">达标奖励：</label>
                <div class="col-sm-8">
                    <input name="reachAgentNum" type="text" class="form-control" th:value="${reachAgentNum}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label  is-required">激活奖励：</label>
                <div class="col-sm-8">
                    <input name="actAgentNum" type="text" class="form-control" th:value="${actAgentNum}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label  is-required">流量卡费：</label>
                <div class="col-sm-8">
                    <input name="flowAgentNum" type="text" class="form-control" th:value="${flowAgentNum}">
                </div>
            </div>
        </div>
    </form>
    <div class="form-group">
        <label class="col-sm-3 control-label is-required"></label>
        <div class="col-sm-8">
            <span style="color: #cc0000"
                  class="help-block m-b-none">如更换对象代理编号需填写新代理编号，不填写视为不修改。</span>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "terminal/record"
    var merPrefix = ctx + "merchantInfo/merchantInfo"
    $("#form-record-add").validate({
        focusCleanup: true

    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(merPrefix + "/newMerMigrateUpdate", $('#form-newMigrate-update').serialize());
        }
    }

    function selectAgent() {
        var agentNum = $("#agentNum").val();
        var url = prefix + "/selectAgentInfoRecurve?agentNum="+agentNum;
        $.modal.open("选择代理商", url, '900', "500");
    }
</script>
</body>
</html>